destroy_event_channels(p);
+ delete_all_domain_vfr_rules(p);
+
/*
* Note this means that find_domain_by_id may fail, even when the caller
* holds a reference to the domain being queried. Take care!
write_lock(&net_rule_lock);
- for ( pent = &net_rule_list; pent != NULL; pent = &ent->next )
+ for ( pent = &net_rule_list; (ent = *pent) != NULL; pent = &ent->next )
{
- ent = *pent;
if ( memcmp(rule, &ent->r, sizeof(net_rule_t)) == 0 )
{
*pent = ent->next;
write_unlock(&net_rule_lock);
return 0;
}
+
+void delete_all_domain_vfr_rules(struct task_struct *p)
+{
+ net_rule_ent_t **pent, *ent;
+
+ write_lock(&net_rule_lock);
+
+ for ( pent = &net_rule_list; (ent = *pent) != NULL; )
+ {
+ if ( (ent->r.src_dom == p->domain) || (ent->r.dst_dom == p->domain) )
+ {
+ *pent = ent->next;
+ kmem_cache_free(net_rule_cache, ent);
+ continue;
+ }
+
+ pent = &ent->next;
+ }
+
+ write_unlock(&net_rule_lock);
+}
static char *idx_to_name(unsigned int idx)
{
void unlink_net_vif(net_vif_t *vif);
net_vif_t *net_get_target_vif(u8 *data, unsigned int len, net_vif_t *src_vif);
net_vif_t *find_net_vif(domid_t dom, unsigned int idx);
+void delete_all_domain_vfr_rules(struct task_struct *p);
/*
* Return values from net_get_target_vif: